const path = require('path');
const { spawn } = require('child_process');

const outputPath = path.join(__dirname, 'src/codeTemplate/src/pages');
const prompt = "创建一个登录页面";

const child = spawn('node', [
  'src/index.js',
  '-p',
  prompt,
  '-o',
  outputPath
], {
  stdio: 'inherit'
});

child.on('error', (error) => {
  console.error('Error:', error);
}); 